vhex v1.1.1 - Visual Hex Editor

The 10 Disclaiments
-------------------

1 : Thou shalt not hold me responsible for any damage that occurs to thy 
    computer caused by this program.
2 : Thou shalt not use this program at other peoples risk, but at thy 
    own risk.
3 : Thou shalt not sell this program for thy benefit, unless I get 70% 
    of the share.
4 : Thou shalt not modify this program, unless thou does it secretly.
5 : Thou shalt not redistribute this program, unless thou includes this 
    readme file.
6 : Thou shalt not redistribute this program, unless thou redistributes 
    all the files included with the original files, unmodified.
7 : Thou shalt not take credit for my work, because it tis simply wrong 
    to do so.
8 : Thou shalt not run this program if the executable size does not 
    equal 109588 bytes, unless thou wants a virus.
9 : Thou shalt not run this program with out the requirements stated 
    below, unless thou wants thy program to crash. 
10: Thou shalt not run this program if thou does not agree to the 10 
    disclaiments, unless thou breaks the rule at home where no one finds out 
    what thou hast done.

Requirements
------------

DOS
4MB RAM
VESA 1.2
Mouse

What's New
----------

v1.1.1
* Insert function added

v1.1

* Minor Bug Fixes
* Loads *.fnt, *.cfg with same name as the rom

v1.0

* First Version

Introduction
------------

Vhex is a hex editor that takes in *.fnt files (format discussed later), 
which are graphically stored. This way, we can see the japanese text in 
a rom without typing up a stupid table, which takes ages.

Instructions to use
-------------------

In DOS prompt type:
vhex <rom.smc> [fontdata.fnt]

eg.

C:\GAMES>vhex hunterg.smc hunterg.fnt

If you don't specify a *.fnt, then the program will search your current 
directory for a *.fnt file with the same name as the rom you are 
loading, but if that's not found then default.fnt will be loaded. The 
same applies to the CFG file.

The CFG FILE
------------

This is the configuration for vhex. It is suggested that you modify this 
file before you run the program. The file will begin like this:

;VHex v1.0 CFG File

Version = 1;

which you will leave alone. Following is:

;[Info]

Starting Hex = -1;
Ending Hex 1 = -1;
Ending Hex 2 = -1;
Ending Hex 3 = -1;

This [Info] block is required for the script dump mode. The Start Hex is 
the code of the start of a string. Not all roms will have a starting 
code. If that's the case, set the starting character to a ending 
character. For example, the start code in THG is 0F. The Ending Hex is 
the code that terminates the string. In THG, the code is FF.

;[Bank Info]

Prefix to Bank 1 = -1;
Prefix to Bank 2 = -1;
Prefix to Bank 3 = -1;
Prefix to Bank 4 = -1;

[Bank info] is not correctly termed. A bank is 64k but in this case we 
are talking about chunks of 256 bytes. Anyways, in some games, there is 
more text than 256, so sometimes they use a prefix to locate each 
character. Bank 1 refers to the first 256 characters of the font. In 
THG, bank 1 is not used since the text is reset to the first 256 
character every time. eg. in THG it would look like:

Prefix to Bank 1 = -1;
Prefix to Bank 2 = f9;
Prefix to Bank 3 = fa;
Prefix to Bank 4 = fb;

Some games uses 2 bytes to changes text but that is not supported in 
vhex.

; [Ascii Map]
; Assign a hex value to the corresponding character.

Position of Blank Space = 20;
Position of A = 41;
Position of a = 61;
Position of 1 = 31;
Position of 0 = 30;
Position of . = 2e;
Position of , = 2c;
Position of ? = 3f;
Position of ! = 21;
Position of - = 2d;
Position of + = 2b;
Position of ' = 27;
New Line Character = 0d;

[Ascii Map] is remapping of ascii characters. Feh! Sometimes when you do 
font replacement, your characters aren't in ascii order. Therefore 
having to type in the hex values manually! Uhh, what a pain. Therefore 
you can remap the ascii values by enetering the positions of each 
character into the map above. By the way, you better have replaced the 
font in alphabetical order, or I'll smack you in the head yelling 
"Stupid! Stupid! Stupid!", j/k.

; [Extensions]
; Extensions for future use. Leave as is for now.

Ext1 = -1;
Ext2 = -1;
Ext3 = -1;
Ext4 = -1;
Ext5 = -1;

It says it in the header. Leave it!

Running the program
-------------------

So you got the program running. Now here are the keys:

Up - Go up one line
Down - Go down one line
Right - Go right one
Left - Go left one
PgUp - Scroll Up a page
PgDn - Scroll down a page

Typing in a key will change the value of the selected byte.

F1 - Goto
F2 - Toggle hex/Ascii Mode
F3 - Find
F4 - Find Again
F5 - Script Dump Mode
F6 - Display Font
F7 - Insert bytes
Ctrl^Print Screen - Save a snapshot

F1 - Goto:
Allow you to jump to a position in the rom. The location is in hex.
F2 - Toggle hex/Ascii Mode:
Toggles the hex modify or ascii modify mode. The ascii map comes in to 
play in ascii modify mode. You may type in alphabetical letter in this 
mode to modify the bytes of the rom. The characters typed refers to the 
ascii map and change the hex accordingly to the map.
eg. if in the cfg file

Position of A = b9;
Position of a = 4a;

then typing "A" will change the current byte to b9, and "B" to ba, etc..
F3 - Find:
Allows you to search a string in the rom. If you are in hex modify mode, 
the search string will be in hex. eg. "87FD9A11" However, if you are in 
ascii modify mode tehn the ascii map comes to work here again. The 
search string will be in characters. eg. "Hello" 
F4 - Find Again:
Searches the last string.
F5 - Script Dump Mode:
Not perfected, but will hold for now. Check it out.
F6 - Display Font:
Displays the FNT file.
F7 - Insert Bytes:
Allows you to insert n bytes, specified in hex to the current location. 
If you are in script dump mode, you will have to re-dump it.
Ctrl^Print Screen - Save a snapshot:
Yep. It saves a snapshot of the screen to vhex_xx.gif where xx is a 
number.

The FNT File
------------

This is the FNT file specs. To make these files, you'll be required a 
bit of programming experience. The format is as follows:

First 3 bytes will be the string 'FNT'.
4th byte is a 1.
The remainder of the fnt is the font data itself. 32-bytes per font, 
16x16 font, for 1024 characters. The layout is:

16x16 font layout

byte  1, 2 [7 6 5 4 3 2 1 0] [7 6 5 4 3 2 1 0]
byte  3, 4 [7 6 5 4 3 2 1 0] [7 6 5 4 3 2 1 0]
byte  5, 6 [7 6 5 4 3 2 1 0] [7 6 5 4 3 2 1 0]
byte  7, 8 [7 6 5 4 3 2 1 0] [7 6 5 4 3 2 1 0]
byte  9,10 [7 6 5 4 3 2 1 0] [7 6 5 4 3 2 1 0]
byte 11,12 [7 6 5 4 3 2 1 0] [7 6 5 4 3 2 1 0]
byte 13,14 [7 6 5 4 3 2 1 0] [7 6 5 4 3 2 1 0]
byte 15,16 [7 6 5 4 3 2 1 0] [7 6 5 4 3 2 1 0]
byte 17,18 [7 6 5 4 3 2 1 0] [7 6 5 4 3 2 1 0]
byte 19,20 [7 6 5 4 3 2 1 0] [7 6 5 4 3 2 1 0]
byte 21,22 [7 6 5 4 3 2 1 0] [7 6 5 4 3 2 1 0]
byte 23,24 [7 6 5 4 3 2 1 0] [7 6 5 4 3 2 1 0]
byte 25,26 [7 6 5 4 3 2 1 0] [7 6 5 4 3 2 1 0]
byte 27,28 [7 6 5 4 3 2 1 0] [7 6 5 4 3 2 1 0]
byte 29,30 [7 6 5 4 3 2 1 0] [7 6 5 4 3 2 1 0]
byte 31,32 [7 6 5 4 3 2 1 0] [7 6 5 4 3 2 1 0]

END OF FILE
